package com.ruoyi.rural.service.impl;

import java.util.List;
import java.util.UUID;

import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.rural.mapper.RuralBenefitAnagementDonateMapper;
import com.ruoyi.rural.domain.RuralBenefitAnagementDonate;
import com.ruoyi.rural.service.IRuralBenefitAnagementDonateService;

/**
 * 救济金捐赠Service业务层处理
 * 
 * @author yangming
 * @date 2022-02-14
 */
@Service
public class RuralBenefitAnagementDonateServiceImpl implements IRuralBenefitAnagementDonateService 
{
    @Autowired
    private RuralBenefitAnagementDonateMapper ruralBenefitAnagementDonateMapper;

    /**
     * 查询救济金捐赠
     * 
     * @param id 救济金捐赠主键
     * @return 救济金捐赠
     */
    @Override
    public RuralBenefitAnagementDonate selectRuralBenefitAnagementDonateById(String id)
    {
        return ruralBenefitAnagementDonateMapper.selectRuralBenefitAnagementDonateById(id);
    }

    /**
     * 查询救济金捐赠列表
     * 
     * @param ruralBenefitAnagementDonate 救济金捐赠
     * @return 救济金捐赠
     */
    @Override
    public List<RuralBenefitAnagementDonate> selectRuralBenefitAnagementDonateList(RuralBenefitAnagementDonate ruralBenefitAnagementDonate)
    {
        return ruralBenefitAnagementDonateMapper.selectRuralBenefitAnagementDonateList(ruralBenefitAnagementDonate);
    }

    /**
     * 新增救济金捐赠
     * 
     * @param ruralBenefitAnagementDonate 救济金捐赠
     * @return 结果
     */
    @Override
    public int insertRuralBenefitAnagementDonate(RuralBenefitAnagementDonate ruralBenefitAnagementDonate)
    {
        ruralBenefitAnagementDonate.setId(UUID.randomUUID().toString());
        ruralBenefitAnagementDonate.setCreateTime(DateUtils.getNowDate());
        return ruralBenefitAnagementDonateMapper.insertRuralBenefitAnagementDonate(ruralBenefitAnagementDonate);
    }

    /**
     * 修改救济金捐赠
     * 
     * @param ruralBenefitAnagementDonate 救济金捐赠
     * @return 结果
     */
    @Override
    public int updateRuralBenefitAnagementDonate(RuralBenefitAnagementDonate ruralBenefitAnagementDonate)
    {
        ruralBenefitAnagementDonate.setUpdateTime(DateUtils.getNowDate());
        return ruralBenefitAnagementDonateMapper.updateRuralBenefitAnagementDonate(ruralBenefitAnagementDonate);
    }

    /**
     * 批量删除救济金捐赠
     * 
     * @param ids 需要删除的救济金捐赠主键
     * @return 结果
     */
    @Override
    public int deleteRuralBenefitAnagementDonateByIds(String[] ids)
    {
        return ruralBenefitAnagementDonateMapper.deleteRuralBenefitAnagementDonateByIds(ids);
    }

    /**
     * 删除救济金捐赠信息
     * 
     * @param id 救济金捐赠主键
     * @return 结果
     */
    @Override
    public int deleteRuralBenefitAnagementDonateById(String id)
    {
        return ruralBenefitAnagementDonateMapper.deleteRuralBenefitAnagementDonateById(id);
    }

    @Override
    public List<RuralBenefitAnagementDonate> selectRuralBenefitAnagementDonateListByWeek(RuralBenefitAnagementDonate ruralBenefitAnagementDonate) {
        return ruralBenefitAnagementDonateMapper.selectRuralBenefitAnagementDonateListByWeek(ruralBenefitAnagementDonate);
    }
}
